Added json form validation, refactored API file layout