Break out the endpoint parsing code into new file