Properly send response to browser