update create_layer.
add general 500 error handling.