add urlmap and send error code to client