Add status check ti curl upload.

Only create flag file if curl returns  201 - Created