Refactored parseRequest to get 3 inputs