Correct HTTP response code
Fix variable type bug