diff --git a/src/api/allocate.c b/src/api/allocate.c
index 5d7389dc5a4b36c3414dfeb7a30c6a0d1d50f84a..76422bf8c2061475e15480e6f4f0fa92542d8224 100644
--- a/src/api/allocate.c
+++ b/src/api/allocate.c
@@ -28,6 +28,7 @@ slurm_allocate_resources (job_desc_msg_t * job_desc_msg , resource_allocation_re
 	slurm_msg_t request_msg ;
 	slurm_msg_t response_msg ;
 	return_code_msg_t * slurm_rc_msg ;
+	resource_allocation_response_msg_t * slurm_alloc_msg;
 
 	/* init message connection for message communication with controller */
 	if ( ( sockfd = slurm_open_controller_conn ( ) ) == SLURM_SOCKET_ERROR )
@@ -63,6 +64,11 @@ slurm_allocate_resources (job_desc_msg_t * job_desc_msg , resource_allocation_re
 			slurm_rc_msg = ( return_code_msg_t * ) response_msg . data ;
 			return (int) slurm_rc_msg->return_code;
 			break ;
+		case RESPONSE_RESOURCE_ALLOCATION:
+			slurm_alloc_msg = ( resource_allocation_response_msg_t * ) response_msg . data ;
+			job_desc_msg->job_id = slurm_alloc_msg->job_id;
+			return 0;
+			break ;
 		default:
 			return SLURM_UNEXPECTED_MSG_ERROR ;
 			break ;
@@ -79,6 +85,7 @@ int slurm_job_will_run (job_desc_msg_t * job_desc_msg , resource_allocation_resp
 	slurm_msg_t request_msg ;
 	slurm_msg_t response_msg ;
 	return_code_msg_t * slurm_rc_msg ;
+	resource_allocation_response_msg_t * slurm_alloc_msg;
 
 	/* init message connection for message communication with controller */
 	if ( ( sockfd = slurm_open_controller_conn ( ) ) == SLURM_SOCKET_ERROR )
@@ -104,6 +111,11 @@ int slurm_job_will_run (job_desc_msg_t * job_desc_msg , resource_allocation_resp
 			slurm_rc_msg = ( return_code_msg_t * ) response_msg . data ;
 			return (int) slurm_rc_msg->return_code;
 			break ;
+		case RESPONSE_JOB_WILL_RUN:
+			slurm_alloc_msg = ( resource_allocation_response_msg_t * ) response_msg . data ;
+			job_desc_msg->job_id = slurm_alloc_msg->job_id;
+			return 0;
+			break ;
 		default:
 			return SLURM_UNEXPECTED_MSG_ERROR ;
 			break ;
diff --git a/src/api/submit.c b/src/api/submit.c
index 94d078ef5a03f47fb640abda2ff1af26db48a547..484a39db2727302b2dd43674978a0b17d48a9336 100644
--- a/src/api/submit.c
+++ b/src/api/submit.c
@@ -28,6 +28,7 @@ slurm_submit_batch_job (job_desc_msg_t * job_desc_msg )
         slurm_msg_t request_msg ;
         slurm_msg_t response_msg ;
         return_code_msg_t * slurm_rc_msg ;
+	resource_allocation_response_msg_t * slurm_aloc_resp_msg;
 
         /* init message connection for message communication with controller */
         if ( ( sockfd = slurm_open_controller_conn ( ) ) == SLURM_SOCKET_ERROR )
@@ -53,6 +54,11 @@ slurm_submit_batch_job (job_desc_msg_t * job_desc_msg )
                         slurm_rc_msg = ( return_code_msg_t * ) response_msg . data ;
 			return (int) slurm_rc_msg->return_code ;
                         break ;
+		case RESPONSE_SUBMIT_BATCH_JOB:
+                        slurm_aloc_resp_msg = ( resource_allocation_response_msg_t * ) response_msg . data ;
+			job_desc_msg->job_id = slurm_aloc_resp_msg->job_id;
+			return 0;
+			break;
                 default:
                         return SLURM_UNEXPECTED_MSG_ERROR ;
                         break ;